package main

import "fmt"

func main()  {

	a := 10
	fmt.Println(a) //10
	fmt.Println(&a) //0x4433

	var p1 *int
	fmt.Println(p1) //nil

	p1 = &a
	fmt.Println(p1) //0x5533
	fmt.Println(*p1) //10

	b := 20
	p1 = &b //0x3243

	fmt.Println(p1) //0x3243 这是b的地址
	fmt.Println(*p1) //20 获取到b的地址对应的值

	*p1 = 100
	fmt.Println(p1) //0x3243
	fmt.Println(*p1) //100

	fmt.Println(a) //10
	fmt.Println(b) //100



}
